/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package persistence.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author ali
 */
@Entity
@Table(name = "pharmacies")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Pharmacies.findAll", query = "SELECT p FROM Pharmacies p"),
    @NamedQuery(name = "Pharmacies.findById", query = "SELECT p FROM Pharmacies p WHERE p.id = :id"),
    @NamedQuery(name = "Pharmacies.findByNom", query = "SELECT p FROM Pharmacies p WHERE p.nom = :nom"),
    @NamedQuery(name = "Pharmacies.findByAdresse", query = "SELECT p FROM Pharmacies p WHERE p.adresse = :adresse"),
    @NamedQuery(name = "Pharmacies.findByTel", query = "SELECT p FROM Pharmacies p WHERE p.tel = :tel"),
    @NamedQuery(name = "Pharmacies.findByLatitude", query = "SELECT p FROM Pharmacies p WHERE p.latitude = :latitude"),
    @NamedQuery(name = "Pharmacies.findByLongitude", query = "SELECT p FROM Pharmacies p WHERE p.longitude = :longitude")})
public class Pharmacies implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "nom")
    private String nom;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "adresse")
    private String adresse;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 20)
    @Column(name = "tel")
    private String tel;
    @Basic(optional = false)
    @NotNull
    @Column(name = "latitude")
    private double latitude;
    @Basic(optional = false)
    @NotNull
    @Column(name = "longitude")
    private double longitude;

    public Pharmacies() {
    }

    public Pharmacies(Integer id) {
        this.id = id;
    }

    public Pharmacies(Integer id, String nom, String adresse, String tel, double latitude, double longitude) {
        this.id = id;
        this.nom = nom;
        this.adresse = adresse;
        this.tel = tel;
        this.latitude = latitude;
        this.longitude = longitude;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getNom() {
        return nom;
    }

    public void setNom(String nom) {
        this.nom = nom;
    }

    public String getAdresse() {
        return adresse;
    }

    public void setAdresse(String adresse) {
        this.adresse = adresse;
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    public double getLatitude() {
        return latitude;
    }

    public void setLatitude(double latitude) {
        this.latitude = latitude;
    }

    public double getLongitude() {
        return longitude;
    }

    public void setLongitude(double longitude) {
        this.longitude = longitude;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Pharmacies)) {
            return false;
        }
        Pharmacies other = (Pharmacies) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "persistence.entity.Pharmacies[ id=" + id + " ]";
    }
    
}
